<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<link  href="skin/css/style.css" rel="stylesheet" type="text/css" />
<link  href="<?php echo $www_root_url;?>/assets/css/jquery.fancybox.css" rel="stylesheet" type="text/css" />
<title>影片管理</title>
<script src="skin/js/common.js" type="text/javascript"></script>
<script src="skin/js/main.js" type="text/javascript"></script>
<script src="<?php echo $www_root_url;?>/assets/js/jquery.js" type="text/javascript"></script>
<script src="<?php echo $www_root_url;?>/assets/js/jquery.fancybox.js" type="text/javascript"></script>
<script src="<?php echo $www_root_url;?>/assets/js/jquery.placeholder.js" type="text/javascript"></script>
<style type="text/css">
.btn {
	border:1px solid;
	border-color:#fff #999 #999 #fff;
	background:#DDDDDD
}
select {
	font-size:12px;
}
</style>
</head>
<body>
<!--当前导航-->
<script type="text/JavaScript">if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='后台首页&nbsp;&raquo;&nbsp;数据&nbsp;&raquo;&nbsp;新闻管理 ';</script>
<?php
$numPerPage=15;
$whereorder = "";
$search = isset($_GET['keyword']) && $_GET['keyword'] ? $_GET['keyword'] : '';
$keyword = RemoveXSS($keyword);
if($keyword){
	$whereorder = "  AND ((name LIKE '%{$keyword}%') OR (act LIKE '%{$keyword}%'))";

}
$csqlStr="select count(*) as dd from `dm_member_seek` where 1= 1 ".$whereorder;
$row = $dsql->GetOne($csqlStr);
if(is_array($row)){
	$TotalResult = $row['dd'];
}else{
	$TotalResult = 0;
}
$TotalPage = ceil($TotalResult/$numPerPage);
if ($page>$TotalPage){
	$page=$TotalPage;
} 
$limitstart = ($page-1) * $numPerPage;
if($limitstart<0){
 $limitstart=0;
}
	$sqlStr="select * from dm_member_seek  where 1=1 ".$whereorder." limit $limitstart,$numPerPage";
?>
<div class="r_main">
  <div class="r_content">
    <div class="r_content_1"><span class="td_border" style="text-align:center"><?php echo $n_id;?></span>
      <table class="tb_style" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="15" class="td_title">&nbsp;求片管理</td>
        </tr>
        <tr>
          <form action="" method="get" >
            <td height="40" align="left" colspan="10">&nbsp;关键字&nbsp;
              <input  name="keyword" type="text" id="keyword" size="40" placeholder="请输入主演或片名">
              <input type="submit" name="selectBtn" value="查 询..." class="btn"  />
             </td>
          </form>
        </tr>
        <?php
if($TotalResult==0){
    if(!empty($keyword)){
    echo "<tr align='center'><td>关键字  <font color=red>\"".$keyword."\"</font>   没有记录</td></tr>";
    }
}else{
	if(!empty($keyword)){
?>
        <tr >
          <td colspan="10">关键字 <font color=red> <?php echo $keyword;?> </font> 的记录如下</td>
        </tr>
        <?php
	}
}
?>
        <tr bgcolor="#f5fafe">
          <td height="30" align="center" bgcolor="#FFFFFF" class="td_btop3">&nbsp;ID</td>
          <td bgcolor="#FFFFFF" class="td_btop3">片名</td>
          <td bgcolor="#FFFFFF" class="td_btop3">主演</td>
          <td bgcolor="#FFFFFF" class="td_btop3">时间</td>
          <td bgcolor="#FFFFFF" class="td_btop3">状态</td>
          <td align="center" bgcolor="#FFFFFF" class="td_btop3">操作</td>
        </tr>
        <form method="post" name="videolistform">
          <?php

$dsql->SetQuery($sqlStr);
$dsql->Execute('video_list');
while($row=$dsql->GetObject('video_list'))
{
$n_id=$row->id;
//$tid=$row->tid;
//$contentUrl=getArticleLink($tid,$n_id,'');
?>
          <tr bgcolor="#f5fafe" id="topictr<?php echo $row->id;?>">
            <td height="30" class="td_border" style="text-align:center"><input type="checkbox" value="<?php echo $n_id;?>" name="e_id[]" class="checkbox" />
              <?php echo $n_id; ?></td>
            <td class="td_border"><?php echo $row->name;?></td>
            <td class="td_border"><?php echo $row->act;?></td>
            <td class="td_border"><span title="<?php echo date('Y-m-d H:i:s',$row->ctime);?>"><?php echo date('Y-m-d H:i:s',$row->ctime);?></span></td>
            <td class="td_border"><?php echo $member_seek_status[$row->status];?></td>
            <td class="td_border" align="center">
				<?php if($row->status == 0){?>
					<a href="javascript:;" style="cursor:pointer" onclick="center_page_view(<?php echo $row->id;?>,topicdes);">通过</a> 
					<a href="javascript:;" onclick="center_page_view2(<?php echo $row->id;?>,topicdes);">不通过</a> 
				<?php } ?>
				<a href="?action=del&id=<?php echo $n_id;?>" onClick="return confirm('确定要删除吗')">删除</a>
				<a href="?action=show&id=<?php echo $n_id;?>">详细</a>
          </tr>
          <?php }?>
          <tr>
            <td height="30" colspan="11" class="td_border">
              
          </tr>
        </form>
        <tr>
          <td height="30" colspan="11" class="td_border"><?php if($n_recycled=="ok"){ ?>
            <div class="cuspages">
              <div class="pages"> &nbsp;页次：<?php echo $page;?>/<?php echo $TotalPage;?> 每页<?php echo $numPerPage;?> 总收录数据<?php echo $TotalResult;?>条 <a href="?page=1&n_recycled=ok&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">首页</a> <a href="?page=<?php echo ($page-1);?>&n_recycled=ok&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">上一页</a> <?php echo makePageNumber($page, 10, $TotalPage, "videolist");?> <a href="?page=<?php echo ($page+1);?>&n_recycled=ok&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">下一页</a> <a href="?page=<?php echo $TotalPage;?>&n_recycled=ok&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">尾页</a>&nbsp;&nbsp;跳转
                <input type="text" id="skip" value="" onkeyup="this.value=this.value.replace(/[^\d]+/,'')" style="width:40px"/>
                &nbsp;&nbsp;
                <input type="button" value="确定" class="btn" onclick="location.href='?page='+ document.getElementById('skip').value +'&n_recycled=ok&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>';"/>
              </div>
            </div>
            <?php
}else{ ?>
            <div class="cuspages">
              <div class="pages"> &nbsp;页次：<?php echo $page;?>/<?php echo $TotalPage;?> 每页<?php echo $numPerPage;?> 总收录数据<?php echo $TotalResult;?>条 <a href="?page=1&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">首页</a> <a href="?page=<?php echo ($page-1);?>&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">上一页</a> <?php echo makePageNumber($page, 10, $TotalPage, "videolist");?> <a href="?page=<?php echo ($page+1);?>&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">下一页</a> <a href="?page=<?php echo $TotalPage;?>&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">尾页</a>&nbsp;&nbsp;跳转
                <input type="text" id="skip" value="" onkeyup="this.value=this.value.replace(/[^\d]+/,'')" style="width:40px"/>
                &nbsp;&nbsp;
                <input type="button" value="确定" class="btn" onclick="location.href='?page='+ document.getElementById('skip').value +'&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>';"/>
              </div>
            </div>
            <?php } ?>
          </td>
        </tr>
      </table>
    </div>
  </div>
</div>

<div id="topicdes" style="top:100px; display:none;height:250px;" class="popdiv">
	<div class="poptitie"><img src="skin/images/btn_close.gif" alt="关闭" onClick="center_page_colse()"  />通过该求片 </div>
    <div class="popbody"><div>
	 <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<form id="formdes" action="" method="post">
		<tr>
		  <td width="554" >请选择影片：
				<input type="hidden" name="f_id" id="f_id">
				<input type="hidden" name="video_id" id="video_id">
				<input type="text" name="video_name" id="video_name">
				&nbsp;&nbsp;<a href="admin_common.php?action=video"  class="fancybox_a_btn">请选择影片</a><br/>
				<p style="color:red;margin:10px 0;">由于用户不知道求片的名字，请手动选择影片进行关联</p>
			</td><td></td>
		</tr>
			<tr>
				<td><input type="button" value="通   过" class="rb1" id="tg_btn_submit" /></td>
			</tr>
			<tr id="pass_error_msg">
				<td id="pass_error_msg_text"></td>
			</tr>
	</form>
	</table>
	</div></div>
</div>
<div id="topicdes2" style="top:100px; display:none;height:250px;" class="popdiv">
	<div class="poptitie"><img src="skin/images/btn_close.gif" alt="关闭" onClick="center_page_colse2()"  />通过该求片 </div>
    <div class="popbody"><div>
	 <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<form id="formdes" action="" method="post">
		<tr>
		  <td width="554" >请选择影片：
				<input type="hidden" name="f_id2" id="f_id2">
				<textarea cols="72" rows="5" name="pass_msg" id="pass_msg"></textarea>
				<br/>
				<p style="color:red;margin:10px 0;">请输入不通过的原因,可以不填写</p>
			</td><td></td>
		</tr>
			<tr>
				<td><input type="button" value="不通过" class="rb1" id="btg_btn_submit" /></td>
			</tr>
			<tr id="pass_error_msg">
				<td id="pass_error_msg_text"></td>
			</tr>
	</form>
	</table>
	</div></div>
</div>
<script type="text/javascript" >
	//自定义 必须引用jquery
	function center_page_view(id){
		var topictrObj=getElementsByName("tr","topictr")
		var n=topictrObj.length
		for (var i=0;i<=n-1;i++){
			topictrObj[i].style.background="#ffffff";	
		}
		document.getElementById("topictr"+id).style.background="#E7E7E7";
		
		var left = (document.documentElement.clientWidth-568)/2+"px";
		var top = (getScroll()+60)+"px";
		$('#topicdes').css({'top':top,'left':left});
		$('#topicdes').css('display', 'block');
		document.getElementById("f_id").value=id;
	}
	
	function center_page_colse(){
		$('#topicdes').css('display', 'none');
	
	}
	
	function center_page_view2(id){
		var topictrObj=getElementsByName("tr","topictr")
		var n=topictrObj.length
		for (var i=0;i<=n-1;i++){
			topictrObj[i].style.background="#ffffff";	
		}
		document.getElementById("topictr"+id).style.background="#E7E7E7";
		
		var left = (document.documentElement.clientWidth-568)/2+"px";
		var top = (getScroll()+60)+"px";
		$('#topicdes2').css({'top':top,'left':left});
		$('#topicdes2').css('display', 'block');
		document.getElementById("f_id2").value=id;
	}
	
	function center_page_colse2(){
		$('#topicdes2').css('display', 'none');
	
	}
	
	
	$('.fancybox_a_btn').fancybox({
		type:'iframe',
		padding:0,
		margin:0,
		width:860,
		height:620,
		onStart: function(){
			//处理问题
		}
	});
	
	$('#tg_btn_submit').click(function(){
		ajax_submit();
	
	
	});
	
	$('#btg_btn_submit').click(function(){
		alert('xx');
		var fid = $('#f_id2').val();
		if(!fid){
			alert('参数有误');
			//$('#login_captcha').focus();
			return false;
		}
		$.ajax( {    
		url:'<?php echo $www_root_url;?>/admin/admin_member_seek.php?action=no_pass',// 跳转到 action
		data:{'fid':fid},
		type:'post',    
		cache:false,    
		dataType:'json',    
		success:function(data){					
				if(data.status){
					alert('不通过成功');
					location.reload();
				}else{
					alert(data.error_msg);						
					return false;
				}						
			} 
		});	
	});
	function ajax_submit(){
		var video_id = $('#video_id').val();
		var video_name = $('#video_name').val();
		var fid = $('#f_id').val();
		if(!video_id || !video_name){
			alert('请选择影片进行关联');
			//$('#login_captcha').focus();
			return false;
		}
		$.ajax( {    
		url:'<?php echo $www_root_url;?>/admin/admin_member_seek.php?action=pass',// 跳转到 action
		data:{'video_id':video_id,'fid':fid},
		type:'post',    
		cache:false,    
		dataType:'json',    
		success:function(data){					
				if(data.status){
					alert('通过成功');
					location.reload();
				}else{
					alert(data.error_msg);						
					return false;
				}						
			} 
		});	
	}
	
		
</script>	

<?php
viewFoot();
?>
</body>
</html>
